﻿using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Web;
using System.Web.Mvc;
namespace Model
{

    [MetadataType(typeof(SendBill_Metadata))]
    [DisplayName("SendBill")]
    public partial class SendBill
    {
        public SendBill()
        {
            this.Id = Guid.NewGuid();
            this.UserId = new Guid(HttpContext.Current.User.Identity.Name);
            this.WriteDateTime = DateTime.Now;
            this.SendGoodsTime = DateTime.Now;
            this.DateTime = DateTime.Now;
            this.Number = "SB-" + DateTime.Now.Year + DateTime.Now.Month + DateTime.Now.Day+"-" + DateTime.Now.Hour + DateTime.Now.Minute + DateTime.Now.Second;
        }

        public class SendBill_Metadata
        {
            [ScaffoldColumn(false)]
            public Guid Id { get; set; }

            [ScaffoldColumn(false)]
            public object Number { get; set; }

            [DisplayName("发货单状态")]
            public object State { get; set; }

            [DisplayName("客户名称")]
            [DropDownList("Customer", "Id", "CustomerName")]
            public object CustomerId { get; set; }

            [DisplayName("联 系 人")]
            [DropDownList("CustomerContact", "Id", "Name")]
            public object CustomerContactId { get; set; }

            [DisplayName("合同订单")]
            [DropDownList("ContactOrder", "Id", "Number")]
            public object ContactOrderId { get; set; }

           

            [DisplayName("开单日期")]
            public object WriteDateTime { get; set; }

            [DisplayName("发货日期")]
            public object SendGoodsTime { get; set; }

            [DisplayName("负责人")]
            [DropDownList("Sys_Users", "Id", "UserName")]
            public object AdminId { get; set; }

            [DisplayName("运费")]
            public object carriage { get; set; }

            [DisplayName("快捷单号")]
            [DisplayFormat(ConvertEmptyStringToNull=false)]
            public object ExpressNumber { get; set; }

            [DisplayName("备注")]
            [DisplayFormat(ConvertEmptyStringToNull = false)]
            [DataType(DataType.MultilineText)]
            public object Description { get; set; }


            [ScaffoldColumn(false)]
            public object DateTime { get; set; }

            [ScaffoldColumn(false)]
            public Guid UserId { get; set; }

            //[DisplayName("标题")]
            //[Required]
            //public object Title { get; set; }



        }
    }
}
